package com.greenhouse.business.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.greenhouse.business.domain.BizInsectSituation;
import com.greenhouse.business.mapper.BizInsectSituationMapper;
import com.greenhouse.business.service.IBizInsectSituationService;
import com.greenhouse.common.utils.DateUtils;

/**
 * 虫情监测结果Service业务层处理
 * 
 * @author greenhouse
 * @date 2021-05-13
 */
@Service
public class BizInsectSituationServiceImpl implements IBizInsectSituationService {
	@Autowired
	private BizInsectSituationMapper bizInsectSituationMapper;

	/**
	 * 查询虫情监测结果
	 * 
	 * @param id 虫情监测结果ID
	 * @return 虫情监测结果
	 */
	@Override
	public BizInsectSituation selectBizInsectSituationById(Long id) {
		return bizInsectSituationMapper.selectBizInsectSituationById(id);
	}

	/**
	 * 查询虫情监测结果列表
	 * 
	 * @param bizInsectSituation 虫情监测结果
	 * @return 虫情监测结果
	 */
	@Override
	public List<BizInsectSituation> selectBizInsectSituationList(BizInsectSituation bizInsectSituation) {
		return bizInsectSituationMapper.selectBizInsectSituationList(bizInsectSituation);
	}

	/**
	 * 新增虫情监测结果
	 * 
	 * @param bizInsectSituation 虫情监测结果
	 * @return 结果
	 */
	@Override
	public int insertBizInsectSituation(BizInsectSituation bizInsectSituation) {
		bizInsectSituation.setCreateTime(DateUtils.getNowDate());
		return bizInsectSituationMapper.insertBizInsectSituation(bizInsectSituation);
	}

	/**
	 * 修改虫情监测结果
	 * 
	 * @param bizInsectSituation 虫情监测结果
	 * @return 结果
	 */
	@Override
	public int updateBizInsectSituation(BizInsectSituation bizInsectSituation) {
		bizInsectSituation.setUpdateTime(DateUtils.getNowDate());
		return bizInsectSituationMapper.updateBizInsectSituation(bizInsectSituation);
	}

	/**
	 * 批量删除虫情监测结果
	 * 
	 * @param ids 需要删除的虫情监测结果ID
	 * @return 结果
	 */
	@Override
	public int deleteBizInsectSituationByIds(Long[] ids) {
		return bizInsectSituationMapper.deleteBizInsectSituationByIds(ids);
	}

	/**
	 * 删除虫情监测结果信息
	 * 
	 * @param id 虫情监测结果ID
	 * @return 结果
	 */
	@Override
	public int deleteBizInsectSituationById(Long id) {
		return bizInsectSituationMapper.deleteBizInsectSituationById(id);
	}
}
